package com.gopay.common.cps.dao.gsrt.impl;

import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.constants.trans.TxnStaCode;
import com.gopay.common.cps.dao.gsrt.GsrtCustBidDao;
import com.gopay.common.domain.gsrt.GsrtCustBid;

/**
 * G商融通投标查询
 * @author ssj
 *
 */
@Repository("gsrtCustBidDao")
public class GsrtCustBidDaoImpl extends BaseDAOImpl<GsrtCustBid, Serializable> implements GsrtCustBidDao {

    @Override
    public List<GsrtCustBid> findByMerCustIdAndBidNo(String merCustId, String bidNo) {
        DetachedCriteria criteria = DetachedCriteria.forClass(GsrtCustBid.class);
        criteria.add(Restrictions.eq("merCustId", merCustId));
        criteria.add(Restrictions.eq("bidNo", bidNo));
        criteria.add(Restrictions.eq("txnStaCd", TxnStaCode.TXN_STA_CD_20000.value));
        List<GsrtCustBid> list = this.findByCriteria(criteria);
        return list;
    }
}
